#ifndef PTZCOTROLLER_H
#define PTZCOTROLLER_H

#include <QObject>
#include <QNetworkAccessManager>
#include "CryptString.h"

class PTZController : public QObject
{
    Q_OBJECT
public:
    explicit PTZController(QString baseUrl, QObject *parent = nullptr);

    // 发送云台控制指令
    void sendControlCommand(const QString& value,
                           int speed = -1,
                           int steps = -1,
                           int stop = -1);

signals:
    // 控制结果信号
    void controlResult(bool success, const QString& msg);

private slots:
    // 处理请求响应
    void onReplyFinished(QNetworkReply* reply);

private:
    QNetworkAccessManager* _networkManager;  // 网络请求管理器
    QString _baseUrl;                        // 设备基础URL（如http://192.168.106.122）
};

#endif // PTZCOTROLLER_H
